<template>
	<view class="container">
		<view class="box">
			<!-- <open-data type="userNickName"></open-data> -->
			<image src="../../static/logo.png" alt="avatar" class="img-u"></image>
			<text class="txt">1</text>
			<button class="butn" size="mini">更改资料</button>
		</view>
		<uni-list>
			<uni-list-item clickable=true @click="todd" title="个人订单" showArrow :thumb='user' thumb-size="base" />
			<uni-list-item clickable=true @click="tokf" title="客服" showArrow :thumb='kf' thumb-size="base" />
		</uni-list>
		<button type="primary" plain="true" class="dz" @click="logout">登出</button>
	</view>
</template>
<script>
	import {
		removeToken
	} from '../../utils/auth.js'
	// import {} from '../../api/user.js'
	export default {
		data() {
			return {
				user: require('../../static/user/use.png'),
				kf: require('../../static/user/kf.png')
			}
		},
		onLoad:function(){
			
		},
		methods: {
			todd() {
				uni.navigateTo({
					url: '/pages/trade/trade'
				})
			},
			tokf() {
				uni.makePhoneCall({
					phoneNumber: '114' //仅为示例
				});
			},
			logout() {
				if (removeToken() == null) {
					uni.showToast({
						title: '登出成功',
						duration: 500
					})
					uni.navigateTo({
						url: '/pages/index/index'
					})
				}

			}
		}
	};
</script>
<style>
	.box {
		padding: 100rpx 100rpx;
		background-image: linear-gradient(to right, cadetblue, aquamarine);
	}

	.img-u {
		width: 150rpx;
		height: 150rpx;
		position: relative;
		left: -64rpx;
		top: 40rpx;
	}

	.txt {
		position: relative;
		left: 66rpx;
		top: -49rpx;
		width: 100rpx;
		height: 100rpx;
		color: aliceblue;
		/* text-align: center; */
		text-decoration: underline;
	}

	.butn {
		position: relative;
		left: -38rpx;
		top: 40rpx;
		width: 188rpx;
		height: 64rpx;
		display: inline-block;
		box-sizing: border-box;
		border: 2px solid aliceblue;
		text-align: center;
		color: aliceblue;
		background-image: linear-gradient(to right, cadetblue, aquamarine);
		border-radius: 30px;
	}

	.dz {
		position: relative;
		left: 1rpx;
		top: 610rpx;
		width: 483rpx;
		height: 92rpx;
		display: block;
		box-sizing: border-box;
	}
</style>
